package com.example.oauth2authserver.service.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.oauth2authserver.mapper.OAuthClientDetailMapper;
import com.example.oauth2authserver.model.OAuthClientDetail;
import com.example.oauth2authserver.service.IOAuthClientDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class OAuthClientDetailServiceImpl extends ServiceImpl<OAuthClientDetailMapper, OAuthClientDetail> implements IOAuthClientDetailService {
    @Autowired
    private OAuthClientDetailMapper oAuthClientDetailMapper;

    @Override
    public OAuthClientDetail findByClientId(String clientId) {
        return oAuthClientDetailMapper.findByClientId(clientId);
    }

    @Override
    public OAuthClientDetail create(OAuthClientDetail oAuthClientDetail) {
        baseMapper.insert(oAuthClientDetail);
        return oAuthClientDetail;
    }
}
